<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>while循环</title>
    <script>
        var i=0; //1.初始化

        while (i<5){ //2.条件

            alert(i); //3、语句

            //i=i+1;//4、自增
            //或者
            i++;
        }
    </script>
</head>
<body>

</body>
</html>